import http from "@/utils/request";

export default {
	upload: {
		url: `/setting/file/upload`,
		name: "文件上传",
		post: async function(data, config={}){
			return await http.post(this.url, data, config);
		}
	},
    folder: {
		list: {
			url: `/setting/folder/list`,
			name: "文件夹列表",
			get: async function(){
				return await http.get(this.url);
			}
		},
        add: {
            url: `/setting/folder/add`,
            name: "新增文件夹",
            post: async function(data){
                return await http.post(this.url, data);
            }
        },
        edit: {
            url: `/setting/folder/edit`,
            name: "编辑文件夹",
            post: async function(data){
                return await http.post(this.url, data);
            }
        },
        move: {
            url: `/setting/folder/move`,
            name: "移动文件夹",
            post: async function(data){
                return await http.post(this.url, data);
            }
        },
        delete: {
            url: `/setting/folder/delete`,
            name: "删除文件夹",
            delete: async function(data){
                return await http.delete(this.url, data);
            }
        }
	},
	file: {
		list: {
			url: `/setting/file/list`,
			name: "文件列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		exts: {
			url: `/setting/file/exts`,
			name: "允许上传文件类型",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
        edit: {
            url: `/setting/file/edit`,
            name: "编辑文件",
            post: async function(data){
                return await http.post(this.url, data);
            }
        },
        delete: {
            url: `/setting/file/delete`,
            name: "删除文件",
            delete: async function(data){
                return await http.delete(this.url, data);
            }
        }
	}
};